<%- include('header', { tabCls: 'users' }); %>
<ul class="list">
  <li class="rank-title">
    <span class="select">
      <a class="<%= type === 'global' ? 'active': '' %>" href="index.html">Global</a>
      <a class="<%= type === 'china' ? 'active': '' %>" href="users.china.html">China</a>
    </span>
  </li>
  <% users.forEach(function(user, idx){ const isUnActive = ((Date.now() - new Date(user.updated_at || '')) / 86400000) > 100;%>
  <li class="<%= isUnActive ? 'unactive' : '' %> <%= user.death ? 'death' : '' %>" id="<%=user.login%>">
    <div class="avatar">
      <a href="<%=user.html_url%>" target="_blank">
        <img src="<%=user.avatar_url%>&s=60" loading="lazy" title="<%=user.name || user.login%>" alt="<%=user.name || user.login%>" />
      </a>
    </div>
    <div class="info">
      <div class="rank">
        <span title="Ranking <%=idx + 1%>"><%=idx + 1%></span>
        <a href="<%=user.html_url%>" target="_blank"><%=user.name || user.login%> <i><%=user.login%></i></a>
      </div>
      <div class="details">
        <svg viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true">
          <path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"></path>
        </svg>
        <span class="localtion"><%=user.location%></span>
        <a href="<%=user.html_url%>?tab=repositories" target="_blank" title="public repositories">
          <svg viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true">
            <path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"></path>
          </svg><span><%=user.public_repos%></span>
        </a>
      </div>
    </div>
    <div class="followers" title="followers">
      <svg viewBox="0 0 16 16" version="1.1" width="12" height="12">
        <path fill-rule="evenodd" d="M16 12.999c0 .439-.45 1-1 1H7.995c-.539 0-.994-.447-.995-.999H1c-.54 0-1-.561-1-1 0-2.634 3-4 3-4s.229-.409 0-1c-.841-.621-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.442.58 2.5 3c.058 2.41-.159 2.379-1 3-.229.59 0 1 0 1s1.549.711 2.42 2.088C9.196 9.369 10 8.999 10 8.999s.229-.409 0-1c-.841-.62-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.437.581 2.495 3c.059 2.41-.158 2.38-1 3-.229.59 0 1 0 1s3.005 1.366 3.005 4z"></path>
      </svg>
      <span><%=user.followers%></span>
    </div>
  </li>
  <% }); %>
</ul>
<%- include('footer', { }); %>